package com.example.backendmanage.mapper;

import com.example.backendmanage.info.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author wl
 * @since 2023-12-09
 */
@Mapper
public interface UserMapper {
    @Select("select * from sys_user")
    List<User> findAll();
    int addUser(User user);
    @Select("select * from sys_user limit #{pageNum},#{pageSize}")
    List<User> pageFind(Integer pageNum,Integer pageSize);
    List<User> search(String username,String email,String address);
    int UpdateUser(User user);
    int delUser(Integer id);
    @Select("select * from sys_user where username=#{username}")
    User login(String username);
    @Select("select * from sys_user where id = #{id}")
    User findUserById(int id);
}
